package com.major.algorithm;

public class Narcissistic {
    public static void main(String[] args) {
        int result = getResult();
        System.out.println(result);
    }

    public static int getResult() {

        int ge, shi, bai,count = 0;

        for (int i = 100; i < 1000; i++) {
            ge = i % 10;
            shi = i / 10 % 10;
            bai = i / 100;
            if (ge * ge * ge + shi * shi * shi + bai * bai * bai == i){
                count++;
            }
        }


        return count;
    }
}
